<?php require_once('header.php'); ?>
<?php //include_once('topwidget.php'); ?>

<div id="contentBox">
<?php include_once('sidebar.php'); ?>

<div id="content">
<h1>All Categories</h1>
<?php
	$catid = $_GET['catid'];
	$allcatquery = "SELECT subcategories.scatid, subcategories.cname, subcategories.cdesc, COUNT(psubcatid) AS psCNT FROM projects, subcategories WHERE projects.psubcatid = subcategories.scid AND scatid =  $catid";

	connection();
	$subcats = mysql_query($allcatquery);
	echo "<ul>";
	while($subcat = mysql_fetch_array($subcats)) {
		echo "<li>";
				echo $subcat['cname']." (".$subcat['psCNT'].")";
				echo "<p>".$subcat['cdesc']."</p>";
		echo "</li>";
?>
<?php
	}
	echo "</ul>";
?>

</div>
<div style="clear:both;"></div>

<?php //include_once('bottomwidget.php'); ?>
<?php include_once('footer.php'); ?>